package pl.edu.pk.mech.kkbus.model;

import static pl.edu.pk.mech.kkbus.staticstrings.NewProperty.*;

import java.io.Serializable;
import java.util.Date;

import com.google.appengine.api.datastore.Entity;

public class New extends Pojo implements Serializable{

	private static final long serialVersionUID = -9172542372482042026L;
	String title;
    String content;
    Date date;
    
    public New() {}
    
    public New(Entity entity){
		this.id = entity.getKey().getId();
    	this.title = (String) entity.getProperty(NEW_TITLE);
    	this.content = (String) entity.getProperty(NEW_CONTENT);
    	this.date = (Date) entity.getProperty(NEW_DATE);
    }

    public New(String title, String content, Date date) {
        this.title = title;
        this.content = content;
        this.date = date;
    }
    
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

}
